import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '消费日期',
    align: "center",
    dataIndex: 'createTime'
  },{
    title: '会员用户名',
    align: "center",
    dataIndex: 'username'
  },
  {
    title: '会员邮箱',
    align: "center",
    dataIndex: 'email'
  },
  {
    title: '消费类型',
    align: "center",
    dataIndex: 'typeText'
  },
  {
    title: '消费小说',
    align: "center",
    dataIndex: 'bookName'
  },
  {
    title: '消费章节',
    align: "center",
    dataIndex: 'indexName'
  }, {
    title: '消费coins',
    align: "center",
    dataIndex: 'amount',
    customRender:({record,text}) => {
      let str=record.type?'-':'+'
      return  str+text;
    },
  },
];
columns.forEach(item=>{
  item.resizable=true
})
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "变动类型 0 充值，1 消费",
    field: 'type',
    component: 'JDictSelectTag',
    componentProps:{
    },
    colProps: {span: 6},
  },
  {
    label: "创建时间",
    field: "createTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
